<!-- 爷爷组件,负责提供零花钱 -->
<template>
    爷爷组件
    <Father></Father>
</template>
<script setup>
import { provide, ref } from 'vue'
import Father from './Father.vue'
const linghuaqian = ref(500);
provide('linghuaqian', linghuaqian); // 爷爷提供了500的零花钱

const sendLinhuaqian = (value) => {
    linghuaqian.value += value;
}
provide('sendLinhuaqian', sendLinhuaqian); // 爷爷提供了加零花钱的方法
</script>
<style scoped></style>